import urllib.request

#将表单数据转换为bytes类型，用utf-8
data=bytes(urllib.parse.urlencode({'name':'Bill','age':30}),encoding='utf-8')

#提交post请求
response=urllib.request.urlopen('http://httpbin.org/post',data=data)
#输出响应
print(response.read().decode('utf-8'))
